<!--高顺-->

<!DOCTYPE html>
<!-- suppress ThymeleafVariablesResolveInspection -->
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <meta name="Author" contect="http://www.webqin.net">
    <title>忘记密码</title>

    <link type="text/css" href="/static/css/gs/wangji.css" rel="stylesheet">
    <script th:src="@{/static/js/jquery-1.8.3.js}" src="/static/js/jquery-1.8.3.js"></script>
</head>
<style>
    #affirm {
        display: none;
        color: red;
    }
</style>
<body>

<div class="content">
    <div class="web-width">
        <div class="for-liucheng">
            <div class="liulist for-cur"></div>
            <div class="liulist for-cur"></div>
            <div class="liulist "></div>
            <div class="liulist"></div>
            <div class="liutextbox">
                <div class="liutext for-cur"><em>1</em><br><strong>填写账户名</strong></div>
                <div class="liutext for-cur"><em>3</em><br><strong>设置新密码</strong></div>
                <div class="liutext for-cur"><em>2</em><br><strong>完成</strong></div>
            </div>
        </div><!--for-liucheng/-->
        <form th:action="@{/user/updatePwd}" method="post" class="forget-pwd" enctype="multipart/form-data" onsubmit="return checkLength()">
            <dl>
                <dt>手机号：</dt>
                <dd><input type="text" id="userPhone" name="userPhone" th:value="${session.phone}" readonly="readonly">
                </dd>
                <div class="clears"></div>
            </dl>
            <dl>
                <dt>新密码：</dt>
                <dd><input type="password" id="userPwd" name="userPwd"></dd>
                <div class="clears"></div>
            </dl>
            <dl>
                <dt>确认密码：</dt>
                <dd><input type="password" id="userPwd2" onblur="querenPwd()"><span id="affirm"></span></dd>

                <div class="clears"></div>
            </dl>
            <div class="subtijiao"><input type="submit" value="提交"></div>
        </form><!--forget-pwd/-->
    </div><!--web-width/-->
</div><!--content/-->

<script>
    function checkLength() {
        var pwd1 = $("#userPwd").val();
        var pwd2 = $("#userPwd2").val();
        if (pwd1 != '' && pwd2 !=''){
            if (pwd1 != pwd2) {
                $("#affirm").css("display", "inline");
                $("#affirm").html(" 两次密码输入不一致！");
                event.preventDefault();
                return false;
            } else {
                $("#affirm").css("display", "none");
                return true;
            }
        } else {
            $("#affirm").css("display", "inline");
            $("#affirm").html("不填完整你提交个什么玩意");
            return false;
        }

    }
    function querenPwd() {
        var pwd1 = $("#userPwd").val();
        var pwd2 = $("#userPwd2").val();
        if (pwd1 != pwd2) {
            $("#affirm").css("display", "inline");
            $("#affirm").html(" 两次密码输入不一致！");
            event.preventDefault();
            return false;
        } else {
            $("#affirm").css("display", "none");
            return true;
        }
    }
</script>

</body>
</html>
